package com.hkts.naturalgas.curvesettings.service.serviceimpl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hkts.naturalgas.curvesettings.entity.HktsCycleTime;
import com.hkts.naturalgas.curvesettings.mapper.HktsCycleTimeMapper;
import com.hkts.naturalgas.curvesettings.service.IHktsCycleTimeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.apache.commons.lang3.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import java.util.List;
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yck
 * @since 2021-11-08
 */
@Service
@Transactional
public class HktsCycleTimeServiceImpl extends ServiceImpl<HktsCycleTimeMapper, HktsCycleTime> implements IHktsCycleTimeService {


@Autowired
private HktsCycleTimeMapper hktsCycleTimeMapper;

@Override
public IPage<HktsCycleTime> selectPage(Page<HktsCycleTime> page, HktsCycleTime hktsCycleTime){
        QueryWrapper<HktsCycleTime> query = Wrappers.query();
        QueryWrapper<HktsCycleTime> entityWrapper = getEntityWrapper(query, hktsCycleTime);
        return hktsCycleTimeMapper.selectPage(page, entityWrapper);
        }




@Override
public List<HktsCycleTime> selectList(HktsCycleTime hktsCycleTime){
        QueryWrapper<HktsCycleTime> query = Wrappers.query();
        QueryWrapper<HktsCycleTime> entityWrapper = getEntityWrapper(query, hktsCycleTime);
        return hktsCycleTimeMapper.selectList(entityWrapper);
        }

/**
 *  公共查询条件
 * @param entityWrapper
 * @return
 */
public QueryWrapper<HktsCycleTime> getEntityWrapper(QueryWrapper<HktsCycleTime> entityWrapper,HktsCycleTime hktsCycleTime){
        //条件拼接

        return entityWrapper;
        }
        }
